/*
 * XML Type:  PresentmentMailSyncResponse
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.PresentmentMailSyncResponse
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML PresentmentMailSyncResponse(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class PresentmentMailSyncResponseImpl extends net.ofx.types.x2003.x04.impl.AbstractSyncResponseImpl implements net.ofx.types.x2003.x04.PresentmentMailSyncResponse
{
    
    public PresentmentMailSyncResponseImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName PRESACCTFROM$0 = 
        new javax.xml.namespace.QName("", "PRESACCTFROM");
    private static final javax.xml.namespace.QName PRESMAILTRNRS$2 = 
        new javax.xml.namespace.QName("", "PRESMAILTRNRS");
    
    
    /**
     * Gets the "PRESACCTFROM" element
     */
    public net.ofx.types.x2003.x04.PresentmentAccount getPRESACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentAccount target = null;
            target = (net.ofx.types.x2003.x04.PresentmentAccount)get_store().find_element_user(PRESACCTFROM$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "PRESACCTFROM" element
     */
    public void setPRESACCTFROM(net.ofx.types.x2003.x04.PresentmentAccount presacctfrom)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentAccount target = null;
            target = (net.ofx.types.x2003.x04.PresentmentAccount)get_store().find_element_user(PRESACCTFROM$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.PresentmentAccount)get_store().add_element_user(PRESACCTFROM$0);
            }
            target.set(presacctfrom);
        }
    }
    
    /**
     * Appends and returns a new empty "PRESACCTFROM" element
     */
    public net.ofx.types.x2003.x04.PresentmentAccount addNewPRESACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentAccount target = null;
            target = (net.ofx.types.x2003.x04.PresentmentAccount)get_store().add_element_user(PRESACCTFROM$0);
            return target;
        }
    }
    
    /**
     * Gets array of all "PRESMAILTRNRS" elements
     */
    public net.ofx.types.x2003.x04.PresentmentMailTransactionResponse[] getPRESMAILTRNRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PRESMAILTRNRS$2, targetList);
            net.ofx.types.x2003.x04.PresentmentMailTransactionResponse[] result = new net.ofx.types.x2003.x04.PresentmentMailTransactionResponse[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "PRESMAILTRNRS" element
     */
    public net.ofx.types.x2003.x04.PresentmentMailTransactionResponse getPRESMAILTRNRSArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentMailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.PresentmentMailTransactionResponse)get_store().find_element_user(PRESMAILTRNRS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "PRESMAILTRNRS" element
     */
    public int sizeOfPRESMAILTRNRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PRESMAILTRNRS$2);
        }
    }
    
    /**
     * Sets array of all "PRESMAILTRNRS" element
     */
    public void setPRESMAILTRNRSArray(net.ofx.types.x2003.x04.PresentmentMailTransactionResponse[] presmailtrnrsArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(presmailtrnrsArray, PRESMAILTRNRS$2);
        }
    }
    
    /**
     * Sets ith "PRESMAILTRNRS" element
     */
    public void setPRESMAILTRNRSArray(int i, net.ofx.types.x2003.x04.PresentmentMailTransactionResponse presmailtrnrs)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentMailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.PresentmentMailTransactionResponse)get_store().find_element_user(PRESMAILTRNRS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(presmailtrnrs);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "PRESMAILTRNRS" element
     */
    public net.ofx.types.x2003.x04.PresentmentMailTransactionResponse insertNewPRESMAILTRNRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentMailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.PresentmentMailTransactionResponse)get_store().insert_element_user(PRESMAILTRNRS$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "PRESMAILTRNRS" element
     */
    public net.ofx.types.x2003.x04.PresentmentMailTransactionResponse addNewPRESMAILTRNRS()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentMailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.PresentmentMailTransactionResponse)get_store().add_element_user(PRESMAILTRNRS$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "PRESMAILTRNRS" element
     */
    public void removePRESMAILTRNRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PRESMAILTRNRS$2, i);
        }
    }
}
